<?php

use yii\db\Migration;

class m170427_024939_init_sql extends Migration
{
    public function up()
    {
        $sql = " INSERT INTO user (username, auth_key, password_hash, created_at, updated_at) VALUES ('admin', 'W-qzFTg8HRqb2QlD_3_DcplklIky80Au', '\$2y\$13\$E4qlgvKdjMGMbJZzHb.7ReqH8BX0MBWKLBUAiaa.EsVysSHxbFCZu', 1489993665, 1489993665)";
        $this->execute($sql);
        $sql = "INSERT INTO department(id, pid, name, status, created_at, updated_at) VALUES (1, 0, '公司', 1, 1489993665, 1489993665)";
        $this->execute($sql);
    }

    // public function down()
    // {
    //     $sql = "delete from user";
    //     $this->execute($sql);
    //     // $sql = "delete from department";
    //     // $this->execute($sql);
    // }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}
